function Blog(marker,n){
	this.id=n;
	this.name='';
	this.description='';
	this.marker=marker;
	this.media=[];
	this.comments=new Array();
	this.nComments=0;
	this.tags=[];
	this.agree=0;
	this.disagree=0;
	this.state='private';
}

Blog.prototype.publish = function(){
	this.state='public';
};

Blog.prototype.addAgree = function(){
	this.agree++;
};

Blog.prototype.addDisagree = function(){
	this.disagree++;
};

Blog.prototype.addComment = function(userId,body){
	$("#comments").html($( "#comments" ).html()+"<div class='panel panel-default'>"+
		"<div class='panel-heading'>"+userId+"</div>"+
			"<div class='panel-body'>"+body+"</div></div>");
	this.comments[this.nComments++]=new Comment(body,userId,this.id);
};

Blog.prototype.loadComment = function(){
	console.log("asdddd");
	for(var i=0;i<nComments;i++){
		$("#comments").html($("#comments").html()+"<div class='panel panel-default'>"+
				"<div class='panel-heading'>"+this.comments[i].userId+"</div>"+
				"<div class='panel-body'>"+this.comments[i].body+"</div></div>");
	}
};

Blog.prototype.getId = function(){
	return this.id;
};

Blog.prototype.setId = function(id){
	this.id=id;
};

Blog.prototype.getName = function(){
	return this.name;
};

Blog.prototype.setName = function(name){
	this.name=name;
};

Blog.prototype.getDescription = function(){
	return this.description;
};

Blog.prototype.setDescription = function(description){
	this.description=description;
};

Blog.prototype.getMarker = function(){
	return this.marker;
};

Blog.prototype.setMarker = function(marker){
	this.marker=marker;
};

Blog.prototype.getMedia = function(){
	return this.media;
};

Blog.prototype.setMedia = function(media){
	this.media=media;
};

Blog.prototype.getComments = function(){
	return this.comments;
};

Blog.prototype.setComments = function(comments){
	this.comments=comments;
};

Blog.prototype.getTags = function(){
	return this.tags;
};

Blog.prototype.setTags = function(tags){
	this.tags=tags;
};

Blog.prototype.getAgree = function(){
	return this.agree;
};

Blog.prototype.setAgree = function(agree){
	this.agree=agree;
};

Blog.prototype.getDisagree = function(){
	return this.agree;
};

Blog.prototype.setDisagree = function(disagree){
	this.disagree=disagree;
};

Blog.prototype.getState = function(){
	this.state;
};

Blog.prototype.setState = function(newState){
	this.state=newState;
};